package com.example.mapper;

import com.example.entity.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AdminMapper {
    @Select("SELECT * FROM admin WHERE username = #{username}")

    Admin selectByUsername(String username);

    void insert(Admin admin);

    void deleteById(Integer id);

    void updateById(Admin admin);
    @Select("SELECT * FROM admin WHERE id = #{id}")
    Admin selectById(Integer id);
//    @Select("SELECT * FROM admin where name like concat('%',#{name},'%') order by id desc")
    List<Admin> selectAll(String name);
}
